# coding:utf-8
from appium import webdriver
from time import sleep
def get_driver():
    caps = {}
    devices ="127.0.0.1:62001"
    caps["platformName"] = "android"
    caps["deviceName"] = devices
    caps["appPackage"] = "com.HaiwellCloud"
    caps["appActivity"] = "com.dosingle.MainActivity"
    caps["automationName"] = "UiAutomator2"
    caps["autoGrantPermissions"] = True
    caps["skipServerInstallation"] = True
    caps["skipDeviceInitialization"] = True
    caps["noReset"] = True
    caps["ensureWebviewsHavePages"] = True
    driver =webdriver.Remote("http://localhost:4723/wd/hub", caps)
    driver.implicitly_wait(10)
    return driver